package com.fingard.dsp.bank.reqrespobj.currencyexchange;

import java.text.ParseException;
import java.util.Date;

import com.fingard.constant.Format;
import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.xml.XmlTextReader;

//结汇购汇数据查询
public class ReqQryExchange extends RequestBase{

	public String askNumber;
	public String bgnDate;
	public String endData;
	public String payAreaCode;
	public String recAreaCode;
	public String payAct;
	public String payCur;
	public String recAct;
	public String recCur;


	
	//private XmlTextReader p_xmlReader;
	public ReqQryExchange(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
		reqHeader = p_header;
		
		if(p_xmlReader.read(PATH_Detail)){//"/ATSYH/TransReq/TransParam/DetailRecord"
			askNumber = p_xmlReader.readedXElement.getSingleText("ReqSeqID");
			bgnDate = p_xmlReader.readedXElement.getSingleText("BgnDate");
			endData = p_xmlReader.readedXElement.getSingleText("EndData");
			payAreaCode = p_xmlReader.readedXElement.getSingleText("PayAreaCode");
			recAreaCode = p_xmlReader.readedXElement.getSingleText("RecAreaCode");
			payAct = p_xmlReader.readedXElement.getSingleText("PayAct");
			payCur = p_xmlReader.readedXElement.getSingleText("PayCur");
			recAct = p_xmlReader.readedXElement.getSingleText("RecAct");
			recCur = p_xmlReader.readedXElement.getSingleText("RecCur");
		}
		else{
			throw new Exception("不存在节点："+PATH_Detail);
		}
	}

	
	public Date getBgnDateTime() throws ParseException{
		return Format.DateTimeFormat.parse(bgnDate);
	}
	public Date getEndDateTime() throws ParseException {
		return Format.Date8Format.parse(endData);
	}
}
